// "Copyright [2021] <Copyright Han>"
#ifndef CONTROLLERADAPTER_H_
#define CONTROLLERADAPTER_H_

#include <stdlib.h>
#include <string.h>
#include "inet/custom/controlAdapter_m_m.h"

#include <omnetpp.h>
#include <iostream>
#include <vector>
#include <map>
#include "inet/node/inet/ACLSingleEntry_m.h"
#include <string.h>
#include <utility>

namespace ai_sim {
class controllerAdapter : public omnetpp::cSimpleModule {
 public:
    std::map<unsigned int, unsigned int> IpAddressMap;  // record the map from outputGateId to IPaddress
    std::map<unsigned int, unsigned int> NetmaskMap; // record the map from outputGateId to mask
    std::map<unsigned int , unsigned int> outputGateInterfaceMap; // record the map from outputGateId to InterfaceID
    std::map<unsigned int , unsigned int> inputGateInterfaceMap; // record the map from inputGateId to InterfaceID
    void sendSingleFlow(int switch_ID, unsigned int SourceAddress, unsigned int DestAddress, unsigned int NextHopAddress,
                int DestPort, int interfaceID, int priority, int protocolID);  // send the route to one router


 protected:
    virtual void handleMessage(omnetpp::cMessage *msg); // 接受来自于Ipv4NetworkConfigurator/controller的信息
};

}
#endif  // CONTROLLERADAPTER_H_
